1.3 Number System Conversions

 

Understanding how to represent numbers is fundamental to digital systems, and various number systems exist, each with a unique base or radix. While humans commonly use the decimal (base-10) system, computers primarily operate using binary (base-2). To bridge this gap and facilitate efficient data processing and communication, it's essential to master the art of number system conversions. This section will delve into the systematic methods for converting numbers between different bases, including binary, octal, decimal, and hexadecimal, providing the tools necessary to translate values across these crucial representations.

 

Part 1.3.1 Conversion from Decimal to Binary Numbers

 

There are two methods for converting DEC to BIN: The Direct Method and Successive Division.

 

Part 1.3.1.a Direct Method

This is the step by step procedure using a direct method.

 

Step 1: Repeatedly subtract the largest power of 2 that is less than or equal to the decimal number.

Step 2: Continue this process until the remainder is zero. Note: A negative remainder is not allowed.

Step 3: For each power of 2 subtracted, write a '1'.

Step 4: List the '1's and '0's in the order in which the subtractions were performed, starting with the highest power of 2 and proceeding to the lowest."

 

Example No. 1

Convert 55 to BIN:

Hint: The largest power of 2 we can use is 2­5 = 32.

 

Minuend

Subtrahend

Difference

Binary Equivalent

55

32

23

1

23

16

7

1

7

8

-1

0

7

4

3

1

3

2

1

1

1

1

0

1

 

Read it from top to bottom, the answer is 1101112

 

Example No. 2

 

Convert 78 to BIN:

Hint: The largest power of 2 we can use is 2­6 = 64.

 

Minuend

Subtrahend

Difference

Binary Equivalent

78

64

14

1

14

32

-18

0

14

16

-2

0

14

8

6

1

6

4

2

1

2

2

0

1

0

1

-1

0

 

Read it from top to bottom, the answer is 1001102

 

Example No. 3

 

Convert 345 to BIN:

Hint: The largest power of 2 we can use is 2­8 = 256.

 

Minuend

Subtrahend

Difference

Binary Equivalent

345

256

89

1

89

128

-39

0

89

64

25

1

25

32

-7

0

25

16

9

1

9

8

1

1

1

4

-3

0

1

2

-1

0

1

1

0

1

 

Read it from top to bottom, the answer is 10101100112

 

 

Part 1.3.1.b Successive Division Method

 This is the step by step procedure using a Successive Division method.

Step 1: Successively divide the decimal number by 2.

 

Step 2: Place the resulting quotient directly below the dividend.

 

Step 3: Place the remainder opposite the quotient for clarity.

 

Step 4: Repeat steps 1-3 until the quotient is less than 2.

 

Step 5: The equivalent binary number is formed by reading the remainders from bottom to top. The first remainder is the least significant bit (LSB), while the last remainder is the most significant bit (MSB).

 

Example No. 4

 

Convert 55 to BIN:

 

Dividend

Divisor

Quotient

Remainder

55

2

27

1

27

2

13

1

13

2

6

1

6

2

3

0

3

2

1

1

1

2

0

1

 

Read it from bottom to top, the answer is 1101112.

 

Example No. 5

Convert 78 to BIN:

 

Dividend

Divisor

Quotient

Remainder

78

2

39

0

39

2

19

1

19

2

9

1

9

2

4

1

4

2

2

0

2

2

1

0

1

2

0

1

 

Read it from bottom to top, the answer is 10011102.

 

Example No. 6

 

Convert 345 to BIN:

Dividend

Divisor

Quotient

Remainder

345

2

172

1

172

2

86

0

86

2

43

0

43

2

21

1

21

2

10

1

10

2

5

0

5

2

2

1

2

2

1

0

1

2

0

1

 

Read it from bottom to top, the answer is 1010110012

 

 

 

Part 1.3.2 Conversion from Binary to Octal Numbers

To convert a binary number to octal, we must group the binary digits into groups of three, starting from the right. Then, convert each group into its equivalent decimal number.

 

 

Example No. 6

 

Convert 1000110101010102 to OCT

 

Solution:

Group the number into group of three

100 011 010 101 010

 

 

5th

3 bit

4th

3 bit

3rd

3 bit

2nd

3 bit

1st

3 bit

 

100

011

010

101

010

3 bit binary string to Decimal

4

3

2

5

2

 

Read it from left to right, the answer is: 432528

 

Example No. 7

 

Convert 111010101011110101012 to OCT

 

Solution:

Group the number into group of three

011 101 010 101 111 010 101

 

 

7th

3bit

6th

3bit

5th

3bit

4th

3bit

3rd

3bit

2nd

3bit

1st

3bit

 

011

101

010

101

111

010

101

3 bit binary string to Decimal

3

5

2

5

7

2

5

 

Read it from left to right, the answer is: 35257258

 

Example No. 8

 

Convert 111111111111111111111112 to OCT

 

Solution:

Group the number into group of three

011 111 111 111 111 111 111 111

 

8th

3bit

7th

3bit

6th

3bit

5th

3bit

4th

3bit

3rd

3bit

2nd

3bit

1st

3bit

 

011

111

111

111

111

111

111

111

3 bit binary string to Decimal

3

7

7

7

7

7

7

7

 

Read it from left to right, the answer is: 37777778

 

 

Part 1.3.3 Conversion from Octal to Binary Numbers

 

Converting octal to binary is the reverse process of converting binary to octal. To convert octal to binary, first convert each octal digit to its equivalent 3-bit binary representation, then concatenate the resulting binary strings.

 

 

Example No. 9

 

Convert 432528 to BIN

 

 

5th

digit

4th

digit

3rd

digit

2nd

digit

1st

digit

 

4

3

2

5

2

Decimal to 3bit Binary String

100

011

010

101

010

 

Read it from left to right, the answer is: 1000110101010102

 

 

Example No. 10

 

Convert 35257258 to BIN

 

 

7th

digit

6th

digit

5th

digit

4th

digit

3rd

digit

2nd

digit

1st

digit

 

3

5

2

5

7

2

5

Decimal to 3bit Binary String

011

101

010

101

111

010

101

 

Read it from left to right, the answer is: 111010101011110101012

 

Example No. 11

 

Convert 37777778 to BIN

 

 

7th

digit

6th

digit

5th

digit

4th

digit

3rd

digit

2nd

digit

1st

digit

 

3

7

7

7

7

7

7

Decimal to 3bit Binary String

011

111

111

111

111

111

111

 

Read it from left to right, the answer is: 111111111111111111111112 

 

Part 1.3.4 Conversion from Binary to Hexadecimal Numbers

To convert a binary number to octal, we must group the binary digits into groups of four, starting from the right. Then, convert each group into its equivalent decimal number.

 

Example No. 12

 

Convert 11101010001010101010100012 to Hexadecimal

Group the number into group of three

0001 1101 0100 0101 0101 0101 0001

 

 

7th

4 string bit

6th

4 string bit

5th

4 string bit

4th

4 string bit

3rd

4 string bit

2nd

4 string bit

1st

4 string bit

 

0001

1101

0100

0101

0101

0101

0001

4 bit binary string to Decimal

1

D

4

5

5

5

1

 

Read it from left to right, the answer is: 1D4555116

 

Example No. 13

 

Convert 11101111000111000111110001111000111112 to Hexadecimal

 

Group the number into group of three

1111 0001 1111 1000 1111 1000 0011 1110 1101 0001

 

 

7th

4 string bit

7th

4 string bit

7th

4 string bit

7th

4 string bit

6th

4 string bit

5th

4 string bit

4th

4 string bit

3rd

4 string bit

2nd

4 string bit

1st

4 string bit

 

1111

0001

1111

1000

1111

1000

0011

1110

1101

0001

4 bit binary string to Decimal

F

1

F

8

F

8

3

E

D

1

 

Read it from left to right, the answer is: 1DE38F8F1F16

 

 

Part 1.3.5 Conversion from Hexadecimal to Binary Numbers

 

Converting hex to binary is the reverse process of converting binary to hex. To convert hex to binary, first convert each hex digit to its equivalent 4-bit binary representation, then concatenate the resulting binary strings.

 

Example No. 14

 

Convert 1D4555116 to Binary

 

 

 

 

7th

digit

6th

digit

5th

digit

4th

digit

3rd

digit

2nd

digit

1st

digit

 

 

 

1

D

4

5

5

5

1

Decimal to 4bit Binary String

 

 

0001

1101

0100

0101

0101

0101

0001

 

Read it from left to right, the answer is: 00011101010001010101010100012

 

 

Example No. 15

 

Convert 1628DDF16 to Binary

 

 

 

 

7th

digit

6th

digit

5th

digit

4th

digit

3rd

digit

2nd

digit

1st

digit

 

 

 

1

6

2

8

D

D

F

Decimal to 4bit Binary String

 

 

0001

0110

0010

1000

1101

1101

1111

 

Read it from left to right, the answer is: 00010110001010001101110111112

 

 

Part 1.3.6 Conversion from Decimal to Octal Numbers

 

Step 1: Successively divide the decimal number by 8.

Step 2: Place the resulting quotient directly below the dividend.

Step 3: Place the remainder opposite the quotient for clarity.

Step 4: Repeat steps 1-3 until the quotient is less than 2.

Step 5: The equivalent octal number is formed by reading the remainders from bottom to top. The first remainder is the least significant bit (LSB), while the last remainder is the most significant bit (MSB).

 

Example No. 16

 

Convert 456 to Octal number:

 

Dividend

Divisor

Quotient

Remainder

456

8

57

0

57

8

7

1

7

8

0

7

 

Let’s read it from bottom to top, the answer is: 7108

 

 

Example No. 17

 

Convert 1453 to Octal number:

 

Dividend

Divisor

Quotient

Remainder

1453

8

181

5

181

8

22

5

22

8

2

6

2

8

0

2

 

Let’s read it from bottom to top, the answer is: 26558

 

Example No. 18

 

Convert 8595 to Octal number:

 

Dividend

Divisor

Quotient

Remainder

8595

8

1074

3

1074

8

134

2

134

8

16

6

16

8

2

0

2

8

0

2

 

Let’s read it from bottom to top, the answer is: 206238

 

Part 1.3.7 Conversion from Decimal to Hexadecimal Numbers

 

Step 1: Successively divide the decimal number by 16.

Step 2: Place the resulting quotient directly below the dividend.

Step 3: Place the remainder opposite the quotient for clarity.

Step 4: Repeat steps 1-3 until the quotient is less than 2.

Step 5: The equivalent oct number is formed by reading the remainders from bottom to top. The first remainder is the least significant bit (LSB), while the last remainder is the most significant bit (MSB).

 

Example No. 19

 

Convert 456 to Hexadecimal number:

 

Dividend

Divisor

Quotient

Remainder

456

16

28

8

28

16

1

C

1

16

0

1

 

Let’s read it from bottom to top, the answer is: 1C816

 

Example No. 20

 

Convert 75839 to Hexadecimal number:

 

Dividend

Divisor

Quotient

Remainder

75839

16

4739

F

4739

16

296

3

296

16

18

8

18

16

1

2

1

16

0

1

 

Let’s read it from bottom to top, the answer is: 1283F16